body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

.image-container {
    position: relative;
    display: inline-block;
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}


.image-container img {
    display: block;
    width: 100%;
    height: auto;
}

.text-item {
    position: absolute;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    white-space: pre-wrap;
    outline: none;
    cursor: move;
}



/* 新增：文本项被选中时添加的阴影效果，以提供更好的视觉反馈 */
.text-item.selected {
    outline: 2px dashed #007bff;
    box-shadow: 0 0 2px #fff, 0 0 0 3px #28a745;
    /* box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 0 4px #28a745; */
}

/* 新增：文本项在编辑时添加的阴影效果，与选中状态区分 */
 .text-item.editing {
    box-shadow:none;
    outline: 2px solid #007bff;
    cursor: text;
}


#settings-panel {
    position: absolute;
    background-color: transparent;
    border-radius: 16px;
    z-index: 999;
    padding: 16px;
    padding-bottom:26px ;
    display: none; 
}

.panel-active{
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
}


.drag-handle:hover {
    cursor: grabbing;
}


.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 10px;
}

.setting-item label {
    font-size: 14px;
    color: #555;
    width : 10em;
}

/* .setting-item div:nth-child(2){
    width: 100px;
} */

.setting-item input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
}

.settings-actions {
    display: flex;
    /* justify-content: space-between; */
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}



/* 走马灯动画定义 */
@keyframes marquee {
    0% {
        background-position: 0% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* 边缘把手 */
.ui-resizable-e, .ui-resizable-w {
    width: 10px;
    cursor: ew-resize;
    top: 0;
    height: 100%;
}

.ui-resizable-e { right: -5px; }
.ui-resizable-w { left: -5px; }

.ui-resizable-n, .ui-resizable-s {
    height: 10px;
    cursor: ns-resize;
    left: 0;
    width: 100%;
}

.ui-resizable-n { top: -5px; }
.ui-resizable-s { bottom: -5px; }

/* 鼠标悬停时显示边缘走马灯线条 */
.ui-resizable-e::after, .ui-resizable-w::after {
    width: 2px;
    height: 80%;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-image: linear-gradient(to top, #d6d6d6, #e6e6e6, #d6d6d6);
    background-size: 100% 200%;
    animation: marquee 2s linear infinite;
}

.ui-resizable-n::after, .ui-resizable-s::after {
    width: 80%;
    height: 2px;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    background-image: linear-gradient(to right, #d6d6d6, #e6e6e6, #d6d6d6);
    background-size: 200% 100%;
    animation: marquee 2s linear infinite;
}

/* 角落把手 */
.ui-resizable-ne, .ui-resizable-nw, .ui-resizable-sw {
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s ease;
    width: 0;
    height: 0;
    border-style: solid;
}

.ui-resizable-ne { 
    top: -10px; 
    right: -10px; 
    cursor: ne-resize; 
    border-width: 0 10px 10px 0; 
    border-color: transparent #ccc transparent transparent;
}

.ui-resizable-nw { 
    top: -10px; 
    left: -10px; 
    cursor: nw-resize; 
    border-width: 10px 10px 0 0; 
    border-color: #ccc transparent transparent transparent;
}

.ui-resizable-sw { 
    bottom: -10px; 
    left: -10px; 
    cursor: sw-resize; 
    border-width: 0 10px 10px 0; 
    border-color: transparent transparent #ccc transparent;
}

/* 关键改动：右下角把手样式 */
.ui-resizable-se {
    bottom: -7px;
    right: -7px;
    cursor: se-resize;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent #888 transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}


/* 默认隐藏所有把手的视觉指示器 */
.ui-resizable-handle::after {
    content: '';
    position: absolute;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drag-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 90%;
    margin-left: -45%;
    height: 60px;
    background-color: transparent;
    cursor: grab;
    z-index: 1050;
}

.settings-content .set {
    margin-top: 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
    margin-bottom: 12px;
}


.settings-content .set {
    font-size: 1.6em;
    font-weight: bold;
    margin: 0;
    top: 10px;
    left: 15px;
    color: #333;
    z-index: 1001;
    margin-bottom: 10px;
}


.settings-content{
    height: inherit;
    border-radius: 16px;
    position: relative;
    background-color: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index:1000;
}


/* 新增：用于处理设置面板折叠时的样式 */
#settings-panel.collapsed {
    width: 40px;
    height: 40px !important;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    resize: none;
    transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease;
}

/* 新增：设置面板折叠时，隐藏其内容 */
#settings-panel.collapsed .settings-content {
    display: none;
}

/* 新增：设置面板折叠时，改变拖拽手柄的样式和位置 */
#settings-panel.collapsed .drag-handle {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin-left: 0;
    background-color: rg;
    border-radius: 16px;
    opacity: 0.8;
}


/* 修改：自定义弹窗的样式，调整位置 */
.custom-alert {
    position: fixed;
    top: 2%; /* 更改为离屏幕顶部10% */
    left: 50%;
    transform: translateX(-50%); /* 确保水平居中 */
    background-color: rgba(50, 50, 50, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.custom-alert.show {
    opacity: 1;
    visibility: visible;
}

.alert-message {
    font-size: 16px;
    display: flex; /* 让图标和文本水平排列 */
    align-items: center; /* 垂直居中对齐 */
    gap: 10px; /* 图标和文本之间的间距 */
}

/* 新增：成功图标的样式 */
.alert-message::before {
    content: '👍';
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50; /* 绿色 */
    animation: fade-in 0.5s ease-out; /* 可选的淡入动画 */
}


/* 可选：淡入动画 */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


.btn-secondary{
    padding: 4px 6px;
    font-size: 0.1em
}



.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* .color-input-group input[type="number"] {
    width: 60px;
    padding: 2px;
    text-align: center;
} */


.form-control{
    height: 4em;
    flex-grow:1;
    background-color: rgba(0, 0, 0, 0.);
    border-radius: 4px;
    padding:4px 6px;
}


#originalImagePathDisplay{
    height: auto;
    flex-grow: 1;
    flex: 1;
}

